$(() => {
    //  仪表盘
    let panel = echarts.init(document.getElementById('panel'));
    let sum = document.getElementById('sum').textContent;   //  计划数
    let finish = document.getElementById('finish').textContent;     //  完成数

    let spanel = echarts.init(document.getElementById('centerPanel'));

    let completionRate = (finish / sum) * 100;
    let panelOption = {
        tooltip: {
            formatter: '{a} <br/>{b} : {c}%'
        },
        /*toolbox: {
            feature: {
                restore: {},
                saveAsImage: {}
            }
        },*/
        series: [
            {
                name: '总体概况',
                type: 'gauge',
                detail: {formatter: '{value}%'},
                title: {               //设置仪表盘中间显示文字样式
                    textStyle: {
                        fontSize: 30,
                        color: "white"
                    }
                },
                data: [{value: completionRate, name: '完成率'}]
            }
        ]
    };
    panel.setOption(panelOption);

    let spanelOption = {
        tooltip: {
            formatter: '{a} <br/>{b} : {c}%'
        },
        series: [
            {
                name: '总体概况',
                type: 'gauge',
                detail: {formatter: '{value}%'},
                title: {               //设置仪表盘中间显示文字样式
                    textStyle: {
                        fontSize: 100,
                        color: "white"
                    }
                },
                data: [{value: completionRate, name: '完成率'}]
            }
        ]
    };
    spanel.setOption(spanelOption);

    $('#leftTop').on('click',function () {
        setTimeout(spanel.resize, 0);
        document.getElementById('cesiumContainer').style.display='none';
        document.getElementById('centerWeather').style.display='none';
        document.getElementById('centerBar').style.display='block';
        document.getElementById('centerForecast').style.display='none';
        document.getElementById('centerImg').style.display='none';
    });

});